package com.springboot.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.springboot.entity.SystemMenuEntity;
import com.springboot.returndata.vo.ResourceAuthMenuVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.Primary;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zyj
 * @since 2023-02-22
 */
@Mapper
@Primary
public interface SystemMenuDao extends BaseMapper<SystemMenuEntity> {

    List<SystemMenuEntity> getAllMenuByType(String type);

    List<SystemMenuEntity> getAllResourceMenu();

    void deleteByCode(@Param("menuCode") String menuCode);

    List<Integer> getRoleMenu(Integer roleId);


    List<String> getMenuAuthorityByCodeUserId(@Param("menuCode") String menuCode, @Param("userId") String userId);


    List<String> getMenuAuthorityByCode(@Param("menuCode") String menuCode);

    List<ResourceAuthMenuVo> getAuthMenuByParent(@Param("menuCode") String menuCode);

    SystemMenuEntity getAuthMenuByCode(@Param("menuCode") String menuCode);

    String getAuthMenuByUserId(Integer userId);
}
